class ButtonUtils {
  /*防止重复点击方法*/
  static debounce(Function fn, {int t = 300}) {
    int timeOld = 0;
    return () {
      int timeNew = DateTime.timestamp().millisecondsSinceEpoch;
      if (timeNew - timeOld < t) {return;}
      fn();
      timeOld = timeNew;
    };
  }
}
